Virtual file system (VFS) is a common component in most operating system (OS) kernels to interface with different file systems so that application processes running on the OS can transparently create, manipulate and access data using the different file systems without specific knowledge regarding the different file systems. VFS implements common functions in the different file system and can be viewed as acting as a multiplexer of the different file systems for the application processes.
Currently, typical VFS design is based on VFS developed for Unix-like kernels, which calls a file system object, such as a file or a directory, a “vnode” or virtual node. In order to speed up repeated access to file system objects, the vnodes are stored in a vnode cache. The life cycles of the vnodes in the vnode cache are managed using multiple reference counts, such as use count, I/O count and kernel use count, which introduce significant complexity to the VFS design. As a result, codes for such a VFS design may be error-prone and hard to understand.
Throughout the description, similar reference numbers may be used to identify similar elements.